package jmine.tec.services.export.impl;

import jmine.tec.services.api.export.ExportAction;
import jmine.tec.services.api.export.ExportTarget;

/**
 * Implementação default de ExportTarget
 * 
 * @author lundberg
 */
public class DefaultExportTarget implements ExportTarget {
    private final ExportAction action;

    private final Object entity;

    /**
     * {@inheritDoc}
     * 
     * @param action action
     * @param entity entity
     */
    public DefaultExportTarget(ExportAction action, Object entity) {
        if (action == null) {
            throw new NullPointerException("Null export action.");
        }
        if (entity == null) {
            throw new NullPointerException("Null export target entity.");
        }
        this.action = action;
        this.entity = ExportUtils.narrow(entity);
    }

    /**
     * @return the action
     */
    public ExportAction getAction() {
        return this.action;
    }

    /**
     * @return the entity
     */
    public Object getEntity() {
        return this.entity;
    }
}
